{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "foods_calories = {}\n",
    "foods_calories['小米粥'] = 45\n",
    "foods_calories['粗粮馒头'] = 223\n",
    "foods_calories['全麦面包'] = 235\n",
    "foods_calories['瘦猪肉'] = 143\n",
    "foods_calories['鸡翅'] = 194\n",
    "foods_calories['培根'] = 181\n",
    "foods_calories['火腿肠'] = 212\n",
    "\n",
    "for food, calory in foods_calories.items():\n",
    "\tprint(\"我吃了二两\" + food + \", 增加了\" + str(calory) + \"千卡路里。\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "sports_consumes = {\"慢走(一小时4公里）\": \"255卡\",\n",
    "                  \"慢跑（一小时9公里）\": \"655卡\",\n",
    "                  \"羽毛球（一小时）\": \"440卡\",\n",
    "                  }\n",
    "                \n",
    "for sport, consume in sports_consumes.items():\n",
    "    active = False\n",
    "    while active == False:\n",
    "    \tanswer = input(sport + \"运动一小时的热量消耗是多少？\")\n",
    "    \tif answer == consume:\n",
    "    \t\tprint(\"回答正确\")\n",
    "    \t\tactive = True\n",
    "    \telse:\n",
    "    \t\tprint(\"回答错误，请再次回答\")foods_calories = {}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "mountains_heights = {\"军峰山\": \"1760.9m\",\n",
    "                    \"九岭头\": \"1794m\",\n",
    "                    \"玉京峰\": \"1819.9m\",\n",
    "                    \"过风拗\": \"1887m\",\n",
    "                    \"五虎岗\": \"1891m\",\n",
    "                    \"白鹤峰\": \"1918.3m\",\n",
    "                    \"齐云山\": \"2061.3m\",\n",
    "                    \"南风面\": \"2120.4m\",\n",
    "                    \"独竖尖\": \"2128m\",\n",
    "                    \"黄岗山\": \"2157.8m\"}\n",
    "\n",
    "for mountain, height in mountains_heights.items():\n",
    "\tprint(mountain + \"海拔\" + height + \"。\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "liu_info = {'身高': '172cm',\n",
    "           '爱好': '吸猫',\n",
    "           '技能': 'python',\n",
    "           '籍贯': '赣州'\n",
    "           }\n",
    "\n",
    "print(\"我知道的刘入铭他：\")\n",
    "for key, value in liu_info.items():\n",
    "\tprint(\"\\n\" + key + \": \" + value )"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
